<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <%@include file="style.jsp" %>
    <%@include file="script.jsp" %>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/orderlang/distributor/css/goods_record.css"/>
    <title>订单详情</title>
</head>
<body onselectstart="return false">
<div id="container_1" style="height:100%">
    <div id="mask-block">
        <div id="outstock">
            <h3>出库确认</h3>
            <div>
                <p><span>出库仓库：</span><s>西南仓库</s></p>
                <p><span>商品种类：</span><s>2</s></p>
                <p><span>出库数量：</span><s>100</s></p>
            </div>
            <p class="confirm">
                <input type="button" value="确认" class="queren"/>
                <input type="reset" value="取消" class="cancel"/>
            </p>
        </div>
    </div>
    <div style="position: relative">
        <%@include file="header.jsp" %>
    </div>
    <div id="content" class="clearfix">
        <%@include file="left_menu.jsp" %>
        <!--内容部分-->
        <div class="right-content" style="margin:75px 20px 0 213px;">
            <p class="brand">
                <a>订单</a>><a href="${pageContext.request.contextPath}/order/findOrderList">订单查询</a>><a class="now">订单详情</a>
            </p>
            <div class="tabs clearfix">
                <div class="fl"><a href="${pageContext.request.contextPath}/order/findOrderInfoDetailById?id=${order.id}">订单详情</a></div>
                <div class="active fl"><a href="${pageContext.request.contextPath}/setOut/findStaySetOutProductDetail?id=${order.id}&state=${order.orderState}">出库/发货记录</a></div>
                <div class="fl"><a href="${pageContext.request.contextPath}/pay/findIncomeRecordList?id=${order.id}">付款记录</a></div>
            </div>
            <div class="content">
                <div class="shipping-Information hide">
                    <h4>发货信息 <span>(如已确认发货，请填写发货信息)</span></h4>
                    <form action="">
                        <div class="clearfix">
                            <div class="date fl">
                                <span>交货日期</span>           
                                <input id="datePicker" readonly type="text" placeholder="请选择开始日期"/>
                                <p class='error hide' style="margin-left:90px;"></p>

                            </div>
                            <div class="transportation fl select-box">
                                <span class="fl">运输方式</span>
                                <div class="fl">
                                    <span>▼</span>
                                    <input type="text" readonly placeholder="自运输/物流运输"/>
                                    <ul class="hide">
                                        <li>自运输</li>
                                        <li>物流运输</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix">
                            <div class="input-box fl">
                                <span>物流公司</span>
                                <input type="text" id="wuliuCom"/>
                            </div>
                            <div class="input-box fl">
                                <span>物流单号</span>
                                <input type="text" id="wuliuNum"/>
                            </div>
                        </div>
                        <div class="clearfix">
                            <div class="input-box fl">
                                <span>联系人</span>
                                <input type="text" id="contactName"/>
                                <p class='error' style="margin-left:90px;"></p>
                            </div>
                            <div class="input-box fl">
                                <span>联系电话</span>
                                <input type="text" id="contactNumber"/>
                                <p class='error' style="margin-left:85px;"></p>
                            </div>
                        </div>
                        <div class="clearfix">
                            <div class="input-box fl">
                                <span>车牌号</span>
                                <input type="text" id="carId"/>
                            </div>
                            <div class="input-box fl">
                                <span>物流备注</span>
                                <input type="text" id="remark"/>
                            </div>
                        </div>
                        <div class="btn-box">
                            <input type="button" class="queren" value="确认"/>
                            <input type="button" class="quxiao" value="取消"/>
                            <input type="reset" class="clean" value="清空"/>
                        </div>
                    </form>
                </div>
                <div class="order-number clearfix" data-id="${order.id}">
                    <p>【${order.orderState}】</p>
                    <p><span>订单号：</span>DH${order.orderCode}</p>
                    <p><span>客户名称：</span>${order.customerName}</p>
                </div>
                <div class="send-out-record">
                    <div class="receive-msg">
				                        收货信息：
				        ${order.consignee}，
				        ${order.mobile}，
				        ${order.address}
                    </div>
                    
                    <!-- ===================================待订单、财务审核============================================ -->
					<c:if test="${order.orderState=='待订单审核' || order.orderState=='待财务审核'}">
					<div >
                        <div class="table-title out-list">
                            <span class="list-title">待审核商品清单</span>
                            <ul class="fr">
                                <li class="chuku">出库</li>
                                <li class="daochu">导出</li>
                                <li class="cancel">取消</li>
                                <li class="update">运输信息更新</li>
                                <li class="print">打印</li>
                            </ul>
                        </div>
                        <table class="wait-review-table">
                            <thead>
                            <tr>
                                <td width="8%">商品图片</td>
                                <td width="40%">商品名称</td>
                                <td width="8%">订购数量</td>
                                <td width="8%">库存数量</td>
                                <td></td>
                            </tr>
                            </thead>
                            <tbody>
							<c:forEach items="${outboundProductDtos}" var="outPro">
                            <tr>
                                <td width="8%">
                                    <div class="fl">
                                        <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
                                    </div>
                                </td>
                                <td width="40%">
                                    <div class="detail fl">
                                        <p>
                                            <span>p351585115${outPro.productCode}</span>
                                        </p>
                                        <p>
                                            <span>现货供应45#无缝管 无缝钢管 价格合理 库存大 可加工定做${outPro.productName}</span>
                                            <span class="fr">规格：25*2.5${outPro.productSpec}</span>
                                        </p>
                                        <p>${outPro.productStandard}</p>
                                    </div>
                                </td>
                                <td width="8%" class="order-count">
                                    ${outPro.quantity}吨
                                </td>
                                <td width="8%">
                                    ${outPro.inventoryQuantity}吨
                                </td>
                                <td></td>
                            </tr>
							</c:forEach>
                            </tbody>
                        </table>
                    </div>
                   </c:if>
                   
                   
                   <!-- ===================================待出库============================================ -->
				   <c:if test="${order.orderState=='待出库'}">
                    <div class='daichuku'>
                        <div class="table-title out-list">
                            <span class="list-title">待出库商品清单</span>
                            <ul class="fr">
                                <li class="chuku">出库</li>
                                <li class="daochu">导出</li>
                                <li class="cancel">取消</li>
                                <li class="update">运输信息更新</li>
                                <li class="print">打印</li>
                            </ul>
                        </div>
                        <div class="warehouse clearfix">
                            <div class="fl select-box">
                                <span class="fl">出库仓库</span>
                                <div class="fl">
                                    <span>▼</span>
                                    <input type="text" readonly/>
                                    <input type="text" class="hide" id="warehouse">
                                    <ul class="hide">
                                      <c:forEach items="${warehouses}" var="w">
			                             <li data-id="${w.id}">${w.name}</li>
			                          </c:forEach>    
                                    </ul>
                                </div>
                            </div>
                            <span class="fl">显示库存大于0的商品</span>
                        </div>
                        <table class="out-table">
                            <thead>
                            <tr>
                                <td width="8%">商品图片</td>
                                <td width="40%">商品名称</td>
                                <td width="8%">订购数量</td>
                                <td width="8%">库存数量</td>
                                <td width="8%">已出库数量</td>
                                <td width="35%">本次出库数量</td>
                                <td></td>
                            </tr>
                            </thead>
                            <tbody>
							<c:forEach items="${outboundProductDtos}" var="outPro">
                            <tr data-id="${outPro.productPriceId}">
                                <td width="8%">
                                    <div class="fl">
                                        <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
                                    </div>
                                </td>
                                <td width="40%">
                                    <div class="detail fl">
                                        <p>
                                            <span>p${outPro.productCode}</span>
                                        </p>
                                        <p>
                                            <span>${outPro.productName}</span>
                                            <span class="fr">${outPro.productSpec}</span>
                                        </p>
                                        <p>${outPro.productStandard}</p>
                                    </div>
                                </td>
                                <td width="8%" class="order-count">
                                    ${outPro.quantity} 吨
                                </td>
                                <td width="8%">
                                    ${outPro.inventoryQuantity}吨
                                </td>
                                <td width="8%"  class="already-count">${outPro.alreadyOutboundQuantity}吨</td>
                                <td width="35%">
                                    <input type="text"  onkeyup="this.value=this.value.replace(/\D/g,'')" value="${outPro.nowOutboundQuantity}" >吨
                                    <h5 class="prompt">本次出库数量不得大于可出库数量(可出库数量=订购数量-已出库数量)</h5>
                                </td>
                                <td></td>
                            </tr>
							</c:forEach>
                            </tbody>
                        </table>
                    </div>
                   </c:if>
                    
                    
                   <!-- ===================================待发货============================================ -->
				   <c:if test="${order.orderState=='待发货'}">
				   <div class='daifahuo'>
                        <div class="table-title send-list">
                            <span class="list-title">待发货商品清单</span>
                            <ul class="fr">
                                <li class="chuku">发货</li>
                                <li class="cancel">取消</li>
                                <li class="daochu">导出</li>
                                <li class="print">打印</li>
                            </ul>
                        </div>
						<c:forEach items="${deliveryProductDtos}" var="deList">
						<div class='table-item'>
	                        <table class="send-table">
	                            <thead>
	                            <tr>
	                                <td width="8%">商品图片</td>
	                                <td width="40%">商品名称</td>
	                                <td width="8%">订购数量</td>
	                                <td width="8%">库存数量</td>
	                                <td width="20%">本次出库数量</td>
	                                <td></td>
	                            </tr>
	                            </thead>
	                            <tbody>
								<c:forEach items="${deList.deliveryProducts}" var="dePro">
	                            <tr>
	                                <td width="8%">
	                                    <div class="fl">
	                                        <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
	                                    </div>
	                                </td>
	                                <td width="40%">
	                                    <div class="detail fl">
	                                        <p>
	                                            <span>p${dePro.productCode}</span>
	                                        </p>
	                                        <p>
	                                            <span>${dePro.productName}</span>
	                                            <span class="fr">规格：${dePro.productSpec}</span>
	                                        </p>
	                                        <p>${dePro.productStandard}</p>
	                                    </div>
	                                </td>
	                                <td width="8%">
	                                   ${dePro.quantity}吨
	                                </td>
	                                <td width="8%">
	                                   ${dePro.inventoryQuantity}吨
	                                </td>
	                                <td width="20%">
	                                   ${dePro.nowOutboundQuantity}吨
	                                </td>
	                                <td></td>
	                            </tr>
								</c:forEach>
	                            </tbody>
	                        </table>
	                        <div class="send-num" style="margin-bottom:20px;">
	                            <p><span>出库编号：</span><span>${deList.code}</span></p>
	                            <p><span>出库日期：</span><fmt:formatDate value="${deList.createTime}" pattern="yyyy-MM-dd hh:mm"/></p>
	                            <p><span>出库仓库：</span>${deList.name}</p>
	                        </div>
                        </div>
						</c:forEach>
                    </div>
                   </c:if>
                   
                   
                   <!-- ===================================待============================================ -->
				   <c:if test="${order.orderState=='待'}"> 
					<div >
                        <div class="table-title send-list">
                            <span class="list-title">待收货商品清单</span>
                            <ul class="fr">
                                <li class="chuku">发货</li>
                                <li class="cancel">取消</li>
                                <li class="daochu">导出</li>
                                <li class="print">打印</li>
                            </ul>
                        </div>
						<c:forEach items="${acceptProductDtos}" var="acList">
                        <table class="send-table">
                            <thead>
                            <tr>
                                <td width="8%">商品图片</td>
                                <td width="40%">商品名称</td>
                                <td width="8%">订购数量</td>
                                <td width="8%">库存数量</td>
                                <td width="20%">本次出库数量</td>
                                <td></td>
                            </tr>
                            </thead>
                            <tbody>
							<c:forEach items="${acList.deliveryProducts}" var="dePro">
                            <tr>
                                <td width="8%">
                                    <div class="fl">
                                        <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
                                    </div>
                                </td>
                                <td width="40%">
                                    <div class="detail fl">
                                        <p>
                                            <span>p${dePro.productCode}</span>
                                        </p>
                                        <p>
                                            <span>${dePro.productName}</span>
                                            <span class="fr">规格：${dePro.productSpec}</span>
                                        </p>
                                        <p>${dePro.productStandard}</p>
                                    </div>
                                </td>
                                <td width="8%">
                                    135
                                </td>
                                <td width="8%">
                                    1000吨
                                </td>
                                <td width="20%">
                                    10吨
                                </td>
                                <td></td>
                            </tr>
							</c:forEach>
                            </tbody>
                        </table>
                        <div class="send-num">
                            <p><span>出库编号：</span>ck1585484616</p>
                            <p><span>出库日期：</span>2017-6-18 14:05</p>
                            <p><span>出库仓库：</span>西南仓库</p>
                        </div>
						</c:forEach>
						
                        <table class="send-table">
                            <thead>
                            <tr>
                                <td width="8%">商品图片</td>
                                <td width="40%">商品名称</td>
                                <td width="8%">订购数量</td>
                                <td width="8%">库存数量</td>
                                <td width="20%">本次出库数量</td>
                                <td></td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td width="8%">
                                    <div class="fl">
                                        <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
                                    </div>
                                </td>
                                <td width="40%">
                                    <div class="detail fl">
                                        <p>
                                            <span>p351585115</span>
                                        </p>
                                        <p>
                                            <span>现货供应45#无缝管 无缝钢管 价格合理 库存大 可加工定做</span>
                                            <span class="fr">规格：25*2.5</span>
                                        </p>
                                        <p>3C</p>
                                    </div>
                                </td>
                                <td width="8%">
                                    135
                                </td>
                                <td width="8%">
                                    1000吨
                                </td>
                                <td width="20%">
                                    10吨
                                </td>
                                <td></td>
                            </tr>
                            
                            
                            </tbody>
                        </table>
                        <div class="send-num">
                            <p><span>出库编号：</span>ck1585484616</p>
                            <p><span>出库日期：</span>2017-6-18 14:05</p>
                            <p><span>出库仓库：</span>西南仓库</p>
                        </div>
						 
                    </div>
                   </c:if>
                   
                   
                   <!-- ===================================待收货============================================ -->
				   <c:if test="${order.orderState=='待收货' || order.orderState=='已完成'}"> 
					<div>
                        <div class="table-title send-list clearfix" style="margin-top: -50px">
                            <ul class="fr">
                                <li class="chuku">收货</li>
                                <li class="cancel">取消</li>
                                <li class="daochu">导出</li>
                                <li class="print">打印</li>
                            </ul>
                        </div>
                        <c:forEach items="${acceptProductDtos}" var="accept">
                        <div style="border: 1px solid #D4D4D4">
                            <div class="send-message">
                                <ul class="clearfix">
                                    <li><span>发货编号：</span>fh${accept.code}</li>
                                    <li><span>发货日期：</span><fmt:formatDate value="${accept.deliveryDate}" pattern="yyyy-MM-dd"/></li>
                                    <li><span>运输方式：</span>${accept.transportMode}</li>
                                    <li><span>物流公司：</span>${accept.logisticsCompany}</li>
                                    <li><span>物流单号：</span>${accept.logisticsBill}</li>
                                    <li><span>联系人：</span>${accept.contact}</li>
                                    <li><span>联系电话：</span>${accept.tel}</li>
                                    <li><span>车牌号：</span>${accept.plateNumber}</li>
                                    <li><span>物流备注：</span>${accept.remark}</li>
                                </ul>
                            </div>
                           
                          
                            <c:forEach items="${accept.outboundBIllListDtos}" var="outBill">
                            <table class="send-product-table">
                                <thead>
                                <tr>
                                    <td width="8%">商品图片</td>
                                    <td width="40%">商品名称</td>
                                    <td width="8%">订购数量</td>
                                    <td width="8%">本次发货数量</td>
                                    <td></td>
                                </tr>
                                </thead>
                                <c:forEach items="${outBill.deliveryProducts}" var="pro">
                                <tbody>
                                <tr>
                                    <td width="8%">
                                        <div class="fl">
                                            <img src="${pageContext.request.contextPath}/img/1.jpg" alt=""/>
                                        </div>
                                    </td>
                                    <td width="40%">
                                        <div class="detail fl">
                                            <p>
                                                <span>p${pro.productCode}</span>
                                            </p>
                                            <p>
                                                <span>${pro.productName}</span>
                                                <span class="fr">规格：${pro.productSpec}</span>
                                            </p>
                                            <p>${pro.productStandard}</p>
                                        </div>
                                    </td>
                                    <td width="8%" class="order-count">
                                        ${pro.quantity}吨
                                    </td>
                                    <td width="8%">
                                        ${pro.nowOutboundQuantity}吨
                                    </td>
                                    <td></td>
                                </tr>
                                </tbody>
                                </c:forEach>
                            </table>
                            <div class="send-num">
                                <p><span>出库编号：</span>ck${outBill.code}</p>
                                <p><span>出库日期：</span><fmt:formatDate value="${outBill.createTime}" pattern="yyyy-MM-dd hh:mm"/></p>
                                <p><span>出库仓库：</span>${outBill.name}</p>
                            </div>
                            </c:forEach>
                        </div>
                        </c:forEach>
                      </div>
					</c:if>
					<!-- ==================================================================================================== -->
					
                </div>
            </div>
        </div>
        <script src="${pageContext.request.contextPath}/static/orderlang/distributor/js/goods_record.js"></script>
        <!--内容部分结束-->
    </div>
</div>

</body>
</html>